package com.wlyuan.open.scanner.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wlyuan.open.scanner.dao.entity.OrderIndexCachesDO;
import com.wlyuan.open.scanner.dao.mapper.OrderIndexCachesMapper;
import com.wlyuan.open.scanner.repository.OrderIndexCacheRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author lijing
 * @description
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class OrderIndexCacheRepositoryImpl implements OrderIndexCacheRepository {
    private final OrderIndexCachesMapper orderIndexCachesMapper;

    @Override
    public OrderIndexCachesDO getByOrderId(Long orderId) {
        LambdaQueryWrapper<OrderIndexCachesDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(OrderIndexCachesDO::getCachesOrderid, orderId);
        return orderIndexCachesMapper.selectOne(wrapper);
    }
}
